<%@page import="java.util.Iterator"%>
<%@page import="shop.factory.DAOFactory"%>
<%@page import="java.util.List,shop.vo.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../css/bootstrap.min.css">
<title></title>
</head>
<%
	if (!(boolean)session.getAttribute("adminLogin")) {
		String path = request.getContextPath() + "/Admin/login.jsp";
		response.sendRedirect(path);
	}
%>
<body>
	<div class="container">
		<h3>商品分类</h3>
		<div class="page-header" style="margin-top:10px;"></div>
		<table class="table table-bordered table-condensed table-striped">
			<tr>
				<td align="center">一级分类</td>
				<td align="center" colspan="4">二级分类</td>
			</tr>
				<%
				List<ProTypeBean> list1 = DAOFactory.getIProTypeDAOInstance().listYiji();
				Iterator<ProTypeBean> it1 = list1.iterator();
					while (it1.hasNext()) {
						ProTypeBean ptype1 = it1.next();
						List<Integer> list2 = DAOFactory.getIProTypeDAOInstance().findErji(ptype1.getPtype_id());
						Iterator<Integer> it2 = list2.iterator();
						int a = list2.size();
				%>
			<tr>
				<td align="center"><%=ptype1.getPtype_name() %></td>
				<%
						while (it2.hasNext()) {
							int id = it2.next();
							ProTypeBean ptype2 = DAOFactory.getIProTypeDAOInstance().find(id);
				%>
				<td align="center"><%=ptype2.getPtype_name() %></td>
				<td><a href="#">删除</a></td>
				<%
						}
					}
				%>
			</tr>
		</table>
	</div>
</body>
</html>